<template>
  <!-- 股东信息 -->
  <div>
    <p style="font-weight: 700">
      股东信息
      <el-button type="primary" style="margin-left: 20px" @click="drawer = true"
        ><el-icon><Plus /></el-icon>新增</el-button
      >
    </p>
    <el-table :data="tableData">
      <el-table-column prop="entShareholderid" label="序号" />
      <el-table-column prop="entShareholdername" label="股东名册" />
      <el-table-column prop="entShareholdertype" label="股东类型" />
      <el-table-column prop="entShareholderdocuments" label="证件类型" />
      <el-table-column prop="entShareholderdid" label="证件号码" />
      <el-table-column prop="entShareholderamount" label="持股份额" />
      <el-table-column prop="entShareholderratio" label="持股比例" />
      <el-table-column label="操作">
        <template #default="scope">
          <el-icon
            style="color: #4eabfe"
            @click="shanchus(scope.row.entShareholderid)"
            ><Delete
          /></el-icon>
        </template>
      </el-table-column>
    </el-table>
    <!-- 抽屉 -->
    <div>
      <el-drawer v-model="drawer" title="I am the title" :with-header="false">
        <gudong></gudong>
      </el-drawer>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";
import { useRouter } from "vue-router";
import { chaxun, shanchu } from "../../../apis/Sltapi/dudong";
import gudong from "@/views/preloan/slt/components/gudong.vue";
const drawer = ref(false);
var router = useRouter();
var tableData = ref([]);
/* 渲染 */
onMounted(async () => {
  var res = await chaxun();
  tableData.value = res.data.data;
});
/* 删除 */
var shanchus = async (row) => {
  var res = await shanchu({ id: row });
  var res = await chaxun();
  tableData.value = res.data.data;
};
</script>

<style scoped>
</style>